<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="__STATIC__/lib/html5shiv.js"></script>
<script type="text/javascript" src="__STATIC__/lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="__STATIC__/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="__STATIC__/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="__STATIC__/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>评价管理</title>
<style type="text/css" media="screen">
    /*.p_box {text-align: center}*/
    #pagination-digg li { border:0; margin-top:10px; padding:0; font-size:14px; list-style:none; /* savers */ float: left }
    #pagination-digg a { border:solid 1px #9aafe5; margin-right:2px; }
    #pagination-digg .previous-off,#pagination-digg .next-off { border:solid 1px #DEDEDE; color:#eeeeee; display:block; float:left; font-weight:bold; margin-right:2px; padding:3px 4px; }
    #pagination-digg .next a,#pagination-digg .previous a { font-weight:; }
    #pagination-digg .active { background:#3b80dc; color:#eeeeee; font-weight:bold; display:block; float:left; padding:4px 6px; /* savers */ margin-right:2px; }
    #pagination-digg a:link,#pagination-digg a:visited { color:black; display:block; float:left; padding:3px 6px; text-decoration:none; }
    #pagination-digg a:hover { border:solid 1px #0e509e; }
    .p_box{
    	float: right;
    }
 </style>
</head>
<body>

<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 评价管理 <span class="c-gray en">&gt;</span> 评价列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>

<div class="page-container">
  <div class="text-c">
  <form action="order_list" method="post">
	  订单编号: <input type="text" name="order_sn" class="input-text" style="width:120px">
	  收货人: <input type="text" name="receiver" class="input-text" style="width:120px">
  	  <input type="submit" id="search" value="搜索" class="btn btn-success">
    <!--   <input type="text" name="search_name" placeholder=" 搜索内容..... " style="width:250px" class="input-text">
      <button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索</button> -->
  </form>
</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"><span class="r">共有数据：<strong>{$res['0']['num']}</strong> 条</span></div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-sort">
			<thead>
				<tr class="text-c">
					<th width="70">订单ID</th>
					<th width="70">订单编号</th>
		          	<th width="70">收货人</th>
		          	<th width="70">当前订单状态</th>
		            <th width="60">修改订单状态</th>
		            <th width="70">下单时间</th>
					<th width="70">操作</th>
				</tr>
			</thead>
			<?php foreach ($data as $key => $v){ ?>
			<tbody>
				<tr class="text-c">
					<td>{$v.order_id}</td>
					<td>{$v.order_sn}</td>
					<td>{$v.receiver}</td>
					<td class="td-status d" >  <!-- 0,已取消 1未付款 2代发货  3待收货4待评价5交易完成 6交易关闭 -->   
						<?php if( $v['status']==0){ ?>
						<span class="label label-success radius qb_{$v.order_id}" data-id="{$v.order_id}"  value="{$v.status}">已取消</span>
						<?php }?>
						<?php else if( $v['status'] ==1 ){ ?>
						<span class="label label-success radius qb_{$v.order_id}" data-id="{$v.order_id}" value="{$v.status}">未付款</span>
						<?php }?> 
						<?php else if( $v['status'] ==2 ){ ?>
						<span class="label label-success radius qb_{$v.order_id}" data-id="{$v.order_id}" value="{$v.status}">待发货</span>
						<?php }?> 
						<?php else if( $v['status'] ==3 ){ ?>
						<span class="label label-success radius qb_{$v.order_id}" data-id="{$v.order_id}" value="{$v.status}">待收货</span>
						<?php }?> 
						<?php else if( $v['status'] ==4 ){ ?>
						<span class="label label-success radius qb_{$v.order_id}" data-id="{$v.order_id}" value="{$v.status}">待评价</span>
						<?php }?> 
					<?php else if( $v['status'] ==5 ){ ?>
						<span class="label label-success radius qb_{$v.order_id}" data-id="{$v.order_id}" value="{$v.status}">申请退款</span>
						<?php }?> 
						<?php else if( $v['status'] ==6 ){ ?>
						<span class="label label-success radius qb_{$v.order_id}" data-id="{$v.order_id}" value="{$v.status}">已退款</span>
						<?php }?> 
						<?php else if( $v['status'] ==7 ){ ?>
						<span class="label label-success radius qb_{$v.order_id}" data-id="{$v.order_id}" value="{$v.status}">交易完成</span>
						<?php }?> 
						<?php else if( $v['status'] ==8 ){ ?>
						<span class="label label-success radius qb_{$v.order_id}" data-id="{$v.order_id}" value="{$v.status}">交易关闭</span>
						<?php }?> 
						
					</td>
					<td class="td-status" id="{$v.order_id}">     
						<?php if( $v['status']==3){ ?>
						<span class="label label-success radius hb_{$v.order_id}" data-id="{$v.order_id}"  value="{$v.status}">已发货</span>
						<?php }?>
						<?php else if($v['status'] ==2 ){ ?>
						<span class="label label-success radius aa hb_{$v.order_id}" data-id="{$v.order_id}" value="{$v.status}">点击确认发货</span>
						<?php }?>
						<?php else if( $v['status'] ==0 ){ ?>
						<span class="label label-success radius hb_{$v.order_id}" data-id="{$v.order_id}" value="{$v.status}">已取消</span>
						<?php }?> 
					</td> 

					<td>{$v.addtime}</td>
					<td>
					<a href="order_details?id=<?php echo $v['order_id'] ?>">查看详情</a>
					</td>
				</tr>
			</tbody>
			<?php } ?>

		</table>
		<div class="p_box">
            <ul id="pagination-digg">
               <li class="next"><a href="{:url('index/order/order_list')}?page=1&order_sn=<?php echo $order_sn ?>&receiver=<?php echo $receiver ?>">首页 &raquo;</a></li>
                <li><a href="{:url('index/order/order_list')}?page=<?php echo $page_arr['prev'] ?>&order_sn=<?php echo $order_sn ?>&receiver=<?php echo $receiver ?>">上一页</a></li>

                <li><a href="{:url('index/order/order_list')}?page=<?php echo $page_arr['next'] ?>&order_sn=<?php echo $order_sn ?>&receiver=<?php echo $receiver ?>">下一页</a></li>
               <li class="next"><a href="{:url('index/order/order_list')}?page=<?php echo $page_arr['last'] ?>&order_sn=<?php echo $order_sn ?>&receiver=<?php echo $receiver ?>">尾页 &raquo;</a></li>
            </ul>
    </div>
	</div>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="__STATIC__/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/lib/layer/2.4/layer.js"></script>
<!-- <script type="text/javascript" src="__STATIC__/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="__STATIC__/static/h-ui.admin/js/H-ui.admin.js"></script> -->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__STATIC__/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="__STATIC__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__STATIC__/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">


$(document).on("click",".aa",function(){ 
		var id = $(this).data('id');
		// alert(id);
		var qb = 'qb_'+id;
		var a= $("."+qb).text();
		var a= $("."+qb).text("待收货");
		//alert(a)
		var order_id=$(this).parent().attr('id');
		var status=$(this).attr('value');
		var _this=$(this).text("已发货");

       $.ajax({
       	 url:"{:URL('index/order/ajaxgai')}",
       	 type:"post",
      	 data:{order_id:order_id,status:status},
      	 success:function(res){
            console.log(res);
             if(res=='1'){
				_this.empty();
				_this.text("已发货");
				_this.attr('value',3);
				alert(_this.text());
            }
     	 }
     })
 })

</script>
</body>
</html>